package org.global.basic;

import org.global.AjaxResult;
import org.global.GEntity;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 基础的增删改查接口
 * @param <ID>
 * @param <T>
 * @param <P>
 * @param <S>
 */
public interface CurdController<ID extends Serializable, T extends GEntity<ID>, P extends ServiceParams<ID, T>, S extends BaseServiceOpImpl<T, ID, P>> {
    S service();

    AjaxResult insert(P p);

    AjaxResult del(P p);

    AjaxResult update(P p) throws Exception;

    AjaxResult all(Map<String, Object> allParams) throws NoSuchMethodException;

    AjaxResult delAllById(List<ID> id) throws ClassNotFoundException;

    AjaxResult page(PageParams page) throws NoSuchMethodException;
}
